import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:yt_devops/components/brn/brn_input_text.dart';
import 'package:yt_devops/components/yt_form/props/base_props.dart';

class BrnTextInputProps extends BaseProps<String> {
  /// 搜索框输入内容改变时候的回调函数
  final BrnInputTextChangeCallback? onTextChange;

  /// 点击确定后的回调
  final BrnInputTextSubmitCallback? onSubmit;

  /// 容器的最大高度，默认 200
  final double maxHeight;

  /// 最小的高度，默认 50
  final double minHeight;

  /// 整个容器的背景颜色，默认 Colors.white
  final Color bgColor;

  /// 输入框的hint文字，默认为"请输入..."
  final String? hint;

  /// 输入框的初始值，默认为""
  /// 不能定义为String，兼容example调用的传值
  final String textString;

  /// 用于对 TextField  更精细的控制，若传入该字段，[textString] 参数将失效，可使用 TextEditingController.text 进行赋值。
  final TextEditingController? textEditingController;

  /// 最大字数，默认200
  final int maxLength;

  /// 最少几行，默认1
  final int minLines;

  /// 文字距离边框的边距，默认 EdgeInsets.zero
  final EdgeInsetsGeometry padding;

  /// 最大hint行数
  final int? maxHintLines;

  /// 搜索框的焦点控制器
  final FocusNode? focusNode;

  /// 键盘输入行为， 默认为 TextInputAction.done
  final TextInputAction textInputAction;

  /// 光标展示
  final bool? autoFocus;

  /// 背景圆角
  final double? borderRadius;

  /// 边框颜色
  final Color? borderColor;

  ///是否可输入
  final bool enabled;
  // 底部字体大小
  final double textLengthSize;

  BrnTextInputProps(
      {super.title,
      super.requireStar,
      super.formControl,
      super.showErrors,
      super.valueAccessor,
      super.validationMessages,
      super.readOnly,
      this.onTextChange,
      this.onSubmit,
      this.maxHeight = 200,
      this.minHeight = 120,
      this.bgColor = Colors.white,
      this.maxLength = 200,
      this.minLines = 3,
      this.hint,
      this.maxHintLines,
      this.padding = const EdgeInsets.fromLTRB(16, 0, 16, 14),
      this.textString = "",
      this.autoFocus,
      this.textEditingController,
      this.focusNode,
      this.textInputAction = TextInputAction.done,
      this.borderRadius,
      this.borderColor,
      this.textLengthSize = 16,
      this.enabled = true});
}
